home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / adoc2140.zip / ADSETUP.MST < prev    next >
Text File  |  1994-07-14  |  19KB  |  627 lines

  1. ''**************************************************************************
  2. ''*                    AutoDoc Setup Script
  3. ''**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''  Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. DECLARE FUNCTION WinExec LIB "kernel.exe" (szCommand$, cmdShow%) AS INTEGER
  11.  
  12. ''
  13. ''  Dialog Template IDs
  14. ''
  15. CONST IDD_DIALOG1 = 100       '' Welcome screen
  16. CONST IDD_DIALOG2 = 101       '' Default or Custom install?
  17. CONST IDD_DIALOG3 = 102       '' OK to quit?
  18. CONST IDD_DIALOG4 = 103       '' Setup failed!
  19. CONST IDD_DIALOG5 = 104       '' Exit on request
  20. CONST IDD_DIALOG6 = 105       '' Setup complete
  21. CONST IDD_DIALOG7 = 106       '' Custom options dialog
  22. CONST IDD_DIALOG8 = 107       '' invisible interface
  23. CONST IDD_DIALOG9 = 108       '' generic help dialog
  24.  
  25. CONST NO_HELP = 0
  26.  
  27. ''  Bitmap IDs
  28. ''
  29. ''  These values correspond to the bitmap resources in the adsetup DLL
  30. ''
  31. CONST Logo480 = 1
  32. CONST Logo600 = 2
  33. CONST Logo768 = 3
  34.  
  35. ''
  36. ''  This ShowWindow() value wAs pulled from Windows.h
  37. ''  and specifies a maximized view of the setup background window
  38. ''
  39. CONST SW_MAXIMIZE = 3
  40.  
  41. GLOBAL DEST$        ''  Default destination directory
  42. GLOBAL OPTCUR$      ''  Option selection from option dialog
  43. GLOBAL CUIDLL$      ''  Custom UI dynalink
  44. GLOBAL NO_HELP_FILE$
  45.  
  46. Declare Function MakePath (szDir$, szFile$) As String
  47. Declare Function Install(AutoDocPath$, SelectList$) As String
  48. Declare Function AddWordProcessor( WPName$, INIFile$ ) As Integer
  49.  
  50. ''
  51. ''  Windows USER.EXE entry points that are not prototyped elsewhere
  52. ''
  53. Declare Sub      ShowWindow LIB "User" (hwnd%, flags%)
  54. Declare Function GetWindowLong LIB "User" (hwnd%, index%) As Long
  55. Declare Function SetWindowLong LIB "User" (hwnd%, index%, value&) As Long
  56. Declare Function GetSectionSize(Section$) As Long
  57.  
  58. ''
  59. ''  The setup script entry point
  60. ''
  61. init:
  62.     cuidll$    = "adsetup.dll"          ''Custom user interface dll
  63.     helpprocs$ = "HelpProcedure"        ''Help dialog procedure
  64.     NO_HELP_FILE$ = ""
  65.     
  66.     ''
  67.     ''  Get the window style of the background window
  68.     ''  The -16 is the index of the long value that represents the stlye
  69.     ''  (taken from Windows.h)
  70.     ''
  71.     Style&=GetWindowLong(HwndFrame(), -16)
  72.     
  73.     ''
  74.     ''  Clear the caption style bits (as taken from Windows.h)
  75.     ''
  76.     Style&=Style&-&h00C00000
  77.     
  78.     ''
  79.     ''  Set the window style back minus undesired elements
  80.     ''
  81.     Style&=SetWindowLong(HwndFrame(), -16, Style&)
  82.     
  83.     ''
  84.     ''  Maximize the background window
  85.     ''
  86.     ShowWindow HwndFrame(), SW_MAXIMIZE
  87.     
  88.     ''
  89.     ''  Get the height value of the screen
  90.     ''
  91.     Height% = GetScreenHeight()
  92.     
  93.     ''
  94.     ''  If there are no other matches, use the 640x480 bitmap background
  95.     ''
  96.     Logo% = Logo480
  97.     
  98.     ''
  99.     ''  Check for and set a 800x600 background
  100.     ''
  101. ''    If Height%=600 Then
  102. ''        Logo%=Logo600
  103. ''    End If
  104.  
  105.     ''
  106.     ''  Check for and set a 1024x768 background
  107.     ''
  108. ''    If Height%=768 Then
  109. ''        Logo%=Logo768
  110. ''    End If
  111.     
  112.     ''
  113.     ''  Set the appropriate bitmap from adsetup.dll
  114.     ''
  115.     SetBitmap cuidll$, Logo
  116.     
  117.     ''
  118.     ''  Specify the Window Title
  119.     ''
  120.     SetTitle "AutoDocumentation System Setup"
  121.  
  122.     ''
  123.     ''  If the source inf path has not been established, create one
  124.     ''
  125.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  126.     IF szInf$ = "" THEN
  127.         szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  128.     END IF
  129.     
  130.     ''
  131.     ''  Load the inf settings
  132.     ''
  133.     ReadInfFile szInf$
  134.  
  135.     ''
  136.     ''  Make sure that the Windows directory is valid
  137.     ''
  138.     i% = SetSizeCheckMode(scmOnIgnore)
  139.     WinDrive$ = Mid$(GetWindowsDir, 1, 1)
  140.     IF IsDriveValid(WinDrive$) = 0 THEN
  141.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "AutoDocumentation System Setup", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  142.         Goto QUIT
  143.     END IF
  144.  
  145.     ''
  146.     ''  The dirty work starts here with the Welcome dialog
  147.     ''
  148. Welcome:
  149.     ''
  150.     ''  Display the Welcome dialog
  151.     ''
  152.     Result$ = UIStartDlg(CUIDLL$, IDD_DIALOG1, "SetupInformationDialog", IDD_DIALOG9, HELPPROC$)
  153.     UIPop 1
  154.     
  155.     ''
  156.     ''  Process the dialog buttons
  157.     ''
  158.     If Result$ <> "CONTINUE" Then
  159.         Gosub AskQuit
  160.         Goto  Welcome
  161.     End If
  162.  
  163. InstallTypeLoop:
  164.     ''
  165.     ''  Display the setup type options dialog
  166.     ''
  167.     Result$ = UIStartDlg(CUIDLL$, IDD_DIALOG2, "SetupTypeDialog", IDD_DIALOG9, HELPPROC$)
  168.     UIPop 1
  169.     
  170.     ''
  171.     ''  Process the dialog buttons
  172.     ''
  173.     if Result$ = "EXIT" then
  174.         Gosub AskQuit
  175.         Goto InstallTypeLoop
  176.     end if
  177.  
  178.     ''
  179.     ''  Get which radio button was selected
  180.     ''
  181.     SelectedInstallType$ = GetSymbolValue("ButtonChecked")
  182.  
  183. GetPaths:
  184.     ''
  185.     ''  Get the setup source directory
  186.     ''
  187.     SourceDirectory$ = GetSymbolValue("STF_SRCDIR")
  188.     
  189.     ''
  190.     ''  Build the size list for the base product
  191.     ''
  192.     AddListItem "BaseList", "BaseProduct"
  193.     AddListItem "BaseList", "Keywords"
  194.     AddListItem "BaseList", "Windows$System"
  195.     SetSymbolValue "BaseSize", STR$(GetSectionSize("BaseList"))
  196.     RemoveSymbol "BaseList"
  197.  
  198.     ''
  199.     ''  Build the size list for the help files
  200.     ''
  201.     AddListItem "HelpList", "Help"
  202.     SetSymbolValue "HelpSize", STR$(GetSectionSize("HelpList"))
  203.     RemoveSymbol "HelpList"
  204.  
  205.     ''
  206.     ''  Build the size list for the sample projects
  207.     ''
  208.     AddListItem "SamplesList", "Samples"
  209.     SetSymbolValue "SamplesSize", STR$(GetSectionSize("SamplesList"))
  210.     RemoveSymbol "SamplesList"
  211.  
  212.     ''
  213.     ''  Build the size list for the Word 2.0 files
  214.     ''
  215.     AddListItem "Word20List", "Word20"
  216.     SetSymbolValue "Word20Size", STR$(GetSectionSize("Word20List"))
  217.     RemoveSymbol "Word20List"
  218.  
  219.     ''
  220.     ''  Build the size list for the Word 6.0 files
  221.     ''
  222.     AddListItem "Word60List", "Word60"
  223.     SetSymbolValue "Word60Size", STR$(GetSectionSize("Word60List"))
  224.     RemoveSymbol "Word60List"
  225.  
  226.     ''
  227.     ''  Set the product path symbol for the settings dialog
  228.     ''
  229.     SetSymbolValue "Edit1", "C:\AUTODOC"
  230.     SetSymbolValue "Edit1Select",  "ALL"
  231.  
  232.     ''
  233.     ''  Specify the default ProgMan group name and target filename
  234.     ''
  235.     SetSymbolValue "DefaultGroup", "AutoDocumenation System"
  236.     SetSymbolValue "TargetFile",   "AUTODOCW.EXE"
  237.     
  238.     ''
  239.     '' Based upon the installation type, either prompt the user
  240.     '' or just go ahead and do stuff
  241.     ''
  242.     if SelectedInstallType$="1" Then        '' Full installation
  243.         AddListItem    "SelectList",   "ON"
  244.         AddListItem    "SelectList",   "ON"
  245.         AddListItem    "SelectList",   "ON"
  246.         AddListItem    "SelectList",   "ON"
  247.         AddListItem    "SelectList",   "ON"
  248.         AddListItem    "SelectList",   "ON"
  249.         SetSymbolValue "DefaultGroupResult", "AutoDocumentation System"
  250.         Result$ = Install("C:\AUTODOC", "SelectList")
  251.         Goto QUIT
  252.     elseif SelectedInstallType$="3" Then    '' Minimal installation
  253.         AddListItem    "SelectList",   "ON"         '' base product
  254.         AddListItem    "SelectList",   "OFF"        '' help files
  255.         AddListItem    "SelectList",   "OFF"        '' sample projects
  256.         AddListItem    "SelectList",   "ON"         '' Word 2.0 support
  257.         AddListItem    "SelectList",   "ON"         '' Word 6.0 support
  258.         AddListItem    "SelectList",   "ON"         '' create icon
  259.         SetSymbolValue "DefaultGroupResult", "AutoDocumentation System"
  260.         Result$ = Install("C:\AUTODOC", "SelectList")
  261.         Goto QUIT
  262.     endif
  263.  
  264.     ''
  265.     '' We'll get here if they're doing a custom installation
  266.     ''
  267.     AddListItem    "SelectList",   "ON"
  268.     AddListItem    "SelectList",   "ON"
  269.     AddListItem    "SelectList",   "ON"
  270.     AddListItem    "SelectList",   "ON"
  271.     AddListItem    "SelectList",   "ON"
  272.     AddListItem    "SelectList",   "ON"
  273.  
  274. PathLoop:
  275.     ''
  276.     ''  Display the setting dialog
  277.     ''
  278.     Result$ = UIStartDlg(CUIDLL$, IDD_DIALOG7, "SetupOptionsDialog", IDD_DIALOG9, HELPPROC$)
  279.     UIPop 1
  280.  
  281.     ''
  282.     ''  Where should we install the software?
  283.     ''
  284.     AutoDocPath$ = GetSymbolValue("Edit1Result")
  285.     if Mid$(AutoDocPath$, Len(AutoDocPath$), 1)="\" then
  286.         AutoDocPath$ = Mid$(AutoDocPath$, 1, Len(AutoDocPath$)-1)
  287.     elseif Mid$(AutoDocPath$, Len(AutoDocPath$),1)="/" then
  288.         AutoDocPath$ = Mid$(AutoDocPath$, 1, Len(AutoDocPath$)-1)
  289.     end if
  290.  
  291.     ''
  292.     ''  Process the dialog buttons
  293.     ''
  294.     If Result$ = "CONTINUE" Then
  295.         If IsDirWritable(AutoDocPath$) = 0 Then
  296.             Gosub BadPath
  297.             Goto PathLoop
  298.         End If
  299.     ELSE
  300.         Gosub AskQuit
  301.         Goto PathLoop
  302.     END IF
  303.  
  304.     ''
  305.     ''  Install the desired files
  306.     ''
  307.     Result$ = Install(AutoDocPath$, "SelectList")
  308.  
  309. QUIT:
  310.     ''
  311.     '' Based upon the current value of ERROR, determine which
  312.     '' termination dialog is to be displayed
  313.     ''
  314.     ON ERROR Goto ErrQuit
  315.     IF ERR = 0 THEN
  316.         dlg% = IDD_DIALOG6          '' Setup is complete
  317.     ELSEIF ERR = STFQUIT THEN
  318.         dlg% = IDD_DIALOG5          '' user clicked Exit button
  319.     ELSE
  320.         dlg% = IDD_DIALOG4          '' failure during setup!
  321.     END IF
  322.  
  323. QuitL1:
  324.     ''
  325.     ''  Display the Quit Dialog
  326.     ''
  327.     sz$ = UIStartDlg(CUIDLL$, dlg%, "SetupInformationNoExitDialog", NO_HELP, NO_HELP_FILE$)
  328. ''    IF sz$ = "REACTIVATE" THEN
  329. ''        Goto QuitL1
  330. ''    END IF
  331.     UIPopAll
  332.     END             '' end of script
  333.  
  334. ErrQuit:
  335.     ''
  336.     ''  Whoa, files were bad!
  337.     ''
  338.     i% = DoMsgBox("Setup sources were corrupted.  Contact vendor for new diskettes.", "AutoDocumentation System Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  339.     UIPopAll
  340.     END         '' end of script
  341.  
  342.  
  343.  
  344. BADPATH:
  345.     ''
  346.     ''  One of the paths were not valid
  347.     ''
  348.     sz$ = UIStartDlg(CUIDLL$, IDD_DIALOG4, "SetupInformationNoExitDialog", NO_HELP, NO_HELP_FILE$)
  349. ''    IF sz$ = "REACTIVATE" THEN
  350. ''        Goto BADPATH
  351. ''    END IF
  352.     UIPop 1
  353.     RETURN
  354.  
  355.  
  356.  
  357. AskQuit:
  358.     ''
  359.     ''  Display the Quit Prompt Dialog
  360.     ''
  361.     sz$ = UIStartDlg(CUIDLL$, IDD_DIALOG3, "SetupQuitDialog", NO_HELP, NO_HELP_FILE$)
  362.     UIPop 1
  363.  
  364.     IF sz$ = "EXIT" THEN
  365.         UIPopAll
  366.         ERROR STFQUIT
  367. ''    ELSEIF sz$ = "REACTIVATE" THEN
  368. ''        Goto AskQuit
  369.     END IF
  370.     RETURN
  371.  
  372.  
  373.  
  374. '**********************************************************************
  375. '** Purpose:
  376. '**     Builds the copy list and performs all installation operations.
  377. '** Arguments:
  378. '**     none.
  379. '** Returns:
  380. '**     none.
  381. '**********************************************************************
  382. Function Install(AutoDocPath$, SelectList$) Static As String
  383.     ''
  384.     ''  Build the source and destination paths
  385.     ''
  386.     SourceDirectory$ = GetSymbolValue("STF_SRCDIR")
  387.     WindowsSystem$   = GetWindowsDir()+"System"
  388.  
  389.     ''
  390.     ''  Create the INI file
  391.     ''
  392.     INIFile$ = AutoDocPath$ + "\AUTODOCW.INI"
  393.  
  394.     ''
  395.     ''  Create the destination root and the SCRIPT subdir if necessary
  396.     ''
  397.     CreateDir AutoDocPath$, cmoNone
  398.  
  399.     ''
  400.     ''  Check and add the base product to the copy list if selected
  401.     ''
  402.     If GetListItem(SelectList, 1)="ON" Then
  403.         ScriptPath$ = AutoDocPath$ + "\SCRIPTS"
  404.         CreateDir ScriptPath$, cmoNone
  405.         CreateIniKeyValue INIFile$, "Directories", "SCRIPT-PATH", ScriptPath$, cmoOverwrite
  406.  
  407.         ProjDirPath$ = AutoDocPath$ + "\PROJECTS"
  408.         CreateDir ProjDirPath$, cmoNone
  409.         CreateIniKeyValue INIFile$, "Directories", "PROJECT-PATH", ProjDirPath$, cmoOverwrite
  410.  
  411.         KywdDirPath$ = AutoDocPath$ + "\KEYWORDS"
  412.         CreateDir KywdDirPath$, cmoNone
  413.         CreateIniKeyValue INIFile$, "Directories", "KEYWORD-PATH", KywdDirPath$, cmoOverwrite
  414.  
  415.         CreateIniKeyValue INIFile$, "Directories", "LANGUAGE-PATH", AutoDocPath$, cmoOverwrite
  416.  
  417.         AddSectionFilesToCopyList "BaseProduct", SourceDirectory$, AutoDocPath$
  418.         AddSectionFilesToCopyList "Keywords", SourceDirectory$, KywdDirPath$
  419.         AddSectionFilesToCopyList "Windows$System", SourceDirectory$, WindowsSystem$
  420.     EndIf
  421.  
  422.     ''
  423.     ''  Check and add the Help files to the copy list if selected
  424.     ''
  425.     If GetListItem(SelectList, 2)="ON" Then
  426.         AddSectionFilesToCopyList "Help", SourceDirectory$, AutoDocPath$
  427.     End If
  428.  
  429.     ''
  430.     ''  Check and add the Samples to the copy list
  431.     ''
  432.     If GetListItem(SelectList, 3)="ON" Then
  433.         SamplesPath$ = AutoDocPath$ + "\SAMPLES"
  434.         CreateDir SamplesPath$, cmoNone
  435.         AddSectionFilesToCopyList "Samples", SourceDirectory$, SamplesPath$
  436.     EndIf
  437.  
  438.     ''
  439.     ''  Check and add Word20 to the copy list
  440.     ''
  441.     If GetListItem(SelectList, 4)="ON" Then
  442.         Word20Path$ = AutoDocPath$ + "\WORD20"
  443.         CreateDir Word20Path$, cmoNone
  444.         AddSectionFilesToCopyList "Word20", SourceDirectory$, Word20Path$
  445.     End If
  446.  
  447.     ''
  448.     ''  Check and add Word60 to the copy list
  449.     ''
  450.     If GetListItem(SelectList, 5)="ON" Then
  451.         Word60Path$ = AutoDocPath$ + "\WORD60"
  452.         CreateDir Word60Path$, cmoNone
  453.         AddSectionFilesToCopyList "Word60", SourceDirectory$, Word60Path$
  454.     End If
  455.  
  456.     ''
  457.     ''  Copy the files...
  458.     ''
  459.     CopyFilesInCopyList
  460.  
  461.     ''
  462.     ''  Reset the copy list
  463.     ''
  464.     ClearCopyList
  465.     Cursor%=ShowWaitCursor()
  466.  
  467.     ''
  468.     ''  Was Word20 installed?
  469.     ''
  470.     If GetListItem(SelectList, 4)="ON" Then
  471.         WP$ = "Microsoft Word 2.0"
  472.         CreateIniKeyValue INIFile$, WP$, "DIR", "WORD20", cmoOverwrite
  473.         CreateIniKeyValue INIFile$, WP$, "DLL", "WORD20.DLL", cmoOverwrite
  474.         Word20$ = GetIniKeyString( INIFile$, WP$, "EXE" )
  475.         If Word20$ = "" Then
  476.             Word20$ = "WINWORD.EXE"
  477.         EndIf
  478.         CreateIniKeyValue INIFile$, WP$, "EXE", Word20$, cmoOverwrite
  479.         Word20$ = GetIniKeyString( INIFile$, WP$, "MACRO-FILE" )
  480.         If Word20$ = "" Then
  481.             Word20$ = "API8X11.DOT"
  482.         EndIf
  483.         CreateIniKeyValue INIFile$, WP$, "MACRO-FILE", Word20$, cmoOverwrite
  484.         i% = AddWordProcessor( WP$, INIFile$ )
  485.     end if
  486.  
  487.     ''
  488.     ''  Was Word60 installed?
  489.     ''
  490.     If GetListItem(SelectList, 5)="ON" Then
  491.         WP$ = "Microsoft Word 6.0"
  492.         CreateIniKeyValue INIFile$, WP$, "DIR", "WORD60", cmoOverwrite
  493.         CreateIniKeyValue INIFile$, WP$, "DLL", "WORD60.DLL", cmoOverwrite
  494.         Word60$ = GetIniKeyString( INIFile$, WP$, "EXE" )
  495.         If Word60$ = "" Then
  496.             Word60$ = "WINWORD.EXE"
  497.         EndIf
  498.         CreateIniKeyValue INIFile$, WP$, "EXE", Word60$, cmoOverwrite
  499.         Word60$ = GetIniKeyString( INIFile$, WP$, "MACRO-FILE" )
  500.         If Word60$ = "" Then
  501.             Word60$ = "API8X11.DOT"
  502.         EndIf
  503.         CreateIniKeyValue INIFile$, WP$, "MACRO-FILE", Word60$, cmoOverwrite
  504.         i% = AddWordProcessor( WP$, INIFile$ )
  505.     end if
  506.  
  507.     RestoreCursor Cursor%
  508.  
  509.     ''
  510.     ''  If the user wants to create a program manager entry, do so...
  511.     ''
  512.     If GetListItem(SelectList, 6)="ON" Then
  513.         ''
  514.         ''  Find out what group the user chose
  515.         ''
  516.         Group$=GetSymbolValue("DefaultGroupResult")
  517.  
  518.         ''
  519.         ''  Create the Program Manager group
  520.         ''
  521.         CreateProgmanGroup Group$, "", cmoNone
  522.  
  523.         ''
  524.         ''  Create the application's item
  525.         ''
  526.         CreateProgmanItem Group$, "AutoDocumentation System", AutoDocPath$+"\AUTODOCW.EXE", "", cmoOverwrite
  527.  
  528.         ''
  529.         ''  Setup an item for the read-me file
  530.         ''
  531.         notepadCmd$ = "NOTEPAD " + AutoDocPath$ + "\README.TXT"
  532.         CreateProgmanItem Group$, "README.TXT", notepadCmd$, "", cmoOverwrite
  533.  
  534.         ''
  535.         ''  Setup an item for the history file
  536.         ''
  537.         CreateProgmanItem Group$, "HISTORY", "NOTEPAD " + AutoDocPath$ + "\HISTORY.TXT", "", cmoOverwrite
  538.  
  539.         ''
  540.         ''  Show the read-me file
  541.         ''
  542.         result% = WinExec( notepadCmd$, 1 )
  543.     End If
  544.  
  545.     ''
  546.     ''  Get the restart count
  547.     ''
  548.     i%=RestartListEmpty()
  549.  
  550.     ''
  551.     ''  If necessary, copy the restart items
  552.     ''
  553.     If i%=0 Then
  554.         i% = DoMsgBox("Setup will now install system components that could not be copied while Windows is running", "AutoDocumentation System Setup", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  555.         i% = ExitExecRestart()
  556.     End If
  557. End Function
  558.  
  559.  
  560.  
  561. '**
  562. '** Purpose:
  563. '**     Appends a file name to the end of a directory path,
  564. '**     inserting a backslAsh character As needed.
  565. '** Arguments:
  566. '**     szDir$  - full directory path (with optional ending "\")
  567. '**     szFile$ - filename to append to directory
  568. '** Returns:
  569. '**     Resulting fully qualified path name.
  570. '*************************************************************************
  571. Function MakePath (szDir$, szFile$) STATIC As String
  572.     IF szDir$ = "" THEN
  573.         MakePath = szFile$
  574.     ELSEIF szFile$ = "" THEN
  575.         MakePath = szDir$
  576.     ELSEIF Mid$(szDir$, LEN(szDir$), 1) = "\" THEN
  577.         MakePath = szDir$ + szFile$
  578.     ELSE
  579.         MakePath = szDir$ + "\" + szFile$
  580.     END IF
  581. END Function
  582.  
  583. ''
  584. ''  Accumulate file sizes from a list
  585. ''
  586. Function GetSectionSize(Section$) Static As Long
  587.     Size& = 0
  588.  
  589.     For SectionIndex% = 1 to GetListLength(Section$)
  590.         Current$ = GetListItem(Section$, SectionIndex%)
  591.         MakeListFromSectionKeys "SizeList", Current$
  592.         listLength% = GetListLength("SizeList")
  593.  
  594.         For Index% = 1 to listLength%
  595.             Result$ = GetListItem("SizeList", Index%)
  596.  
  597.             Size& = Size& + GetSectionKeySize(Current$, Result$)
  598.         Next Index%
  599.  
  600.         RemoveSymbol "SizeList"
  601.     Next SectionIndex%
  602.  
  603.     GetSectionSize = Size&
  604. End Function
  605.  
  606. ''
  607. ''
  608. ''
  609. Function AddWordProcessor( WPName$, INIFile$ ) Static As Integer
  610.     Index% = 0
  611.  
  612. INISearchLoop:
  613.     key$ = "WP"+Mid$(STR$(Index%),2)
  614.     Value$ = GetIniKeyString( INIFile$, "Print", key$)
  615.  
  616.     if Value$ <> WPName$ and Value$ <> "" then
  617.         Index% = Index% + 1
  618.         goto INISearchLoop
  619.     end if
  620.  
  621.     ''
  622.     '' Either we found the entry or Index% points to the 1st open entry
  623.     ''
  624.     CreateIniKeyValue INIFile$, "Print", key$, WPName$, cmoOverwrite
  625.     AddWordProcessor = Index%
  626. End Function
  627.